import request from "@/utils/requestMd5";

export function purchase_index(params) {
  return request({
    url: "/purchase/index",
    method: "get",
    params
  });
}

export function purchase_base(params) {
  return request({
    url: "/purchase/base",
    method: "get",
    params
  });
}

export function purchase_add(data) {
  return request({
    url: "/purchase/add",
    method: "post",
    data: data
  });
}

export function purchase_edit(data) {
  return request({
    url: "/purchase/edit",
    method: "post",
    data: data
  });
}

export function purchaseList_delete(data) {
  return request({
    url: "/purchaseList/delete",
    method: "post",
    data: data
  });
}

export function purchase_info(params) {
  return request({
    url: "/purchase/info",
    method: "get",
    params
  });
}

export function purchase_entryList(data) {
  return request({
    url: "/purchase/entryList",
    method: "post",
    data: data
  });
}

export function purchase_checkPurchase(params) {
  return request({
    url: "/purchase/checkPurchase",
    method: "get",
    params
  });
}

export function purchase_merge(data) {
  return request({
    url: "/purchase/merge",
    method: "post",
    data: data
  });
}

export function purchase_cancel(data) {
  return request({
    url: "/purchase/cancel",
    method: "post",
    data: data
  });
}

export function purchase_cancelList(data) {
  return request({
    url: "/purchase/cancelList",
    method: "post",
    data: data
  });
}

/* 查看采购单详情页面 */
export function export_purchase_info(params) {
  return request({
    url: "/export/export_purchase_info",
    method: "post",
    responseType: "blob",
    params
  });
}

// 获取导出的设置表头
export function export_head_info(data) {
  return request({
    url: "/export/exports_info",
    method: "get",
    data
  });
}

export function export_purchase_list(params) {
  return request({
    url:'/export/export_purchase_list',
    method:'post',
    responseType:"blob",
    params
  })
}